﻿Imports Ecodex.RestAPI

Friend Class TranslateFault
    Public Shared Function ToServiceError(ByVal from As SrvSecurity.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToServiceError(ByVal from As SrvRepository.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToServiceError(ByVal from As SrvClients.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToServiceError(ByVal from As SrvInvoices.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function

    Public Shared Function ToSessionError(ByVal from As SrvSecurity.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function
    Public Shared Function ToSessionError(ByVal from As Exceptions.FallaSesion) As Entity.SessionJsonError
        Dim [to] = New Entity.SessionJsonError() With { _
        .Codigo = from.Codigo, _
        .Mensaje = from.Mensaje _
    }
        Return [to]
    End Function
    Public Shared Function ToSessionError(ByVal from As SrvRepository.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function
    Public Shared Function ToSessionError(ByVal from As SrvClients.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function

    Public Shared Function ToSessionError(ByVal from As SrvInvoices.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As Exceptions.FallaValidacion) As Entity.ValidationJsonError
        Dim [to] = New Entity.ValidationJsonError() With { _
            .Codigo = from.Codigo, _
            .Mensaje = from.Mensaje, _
            .Sugerencia = from.Sugerencia _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As SrvInvoices.FallaValidacion) As Entity.ValidationError
        Dim [to] = New Entity.ValidationError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .Node = from.Nodo, _
          .Antecedent = from.Antecedente, _
          .Suggestion = from.Sugerencia, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToServiceError(ByVal from As SrvTimbrado.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToServiceError(ByVal from As SrvCancelation.FallaServicio) As Entity.ServiceError
        Dim [to] = New Entity.ServiceError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToSessionError(ByVal from As SrvTimbrado.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function
    Public Shared Function ToSessionError(ByVal from As SrvCancelation.FallaSesion) As Entity.SessionError
        Dim [to] = New Entity.SessionError() With { _
          .RFC = from.RFC, _
          .Status = from.Estatus, _
          .Description = from.Descripcion _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As SrvTimbrado.FallaValidacion) As Entity.ValidationError
        Dim [to] = New Entity.ValidationError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .Node = from.Nodo, _
          .Antecedent = from.Antecedente, _
          .Suggestion = from.Sugerencia, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As SrvClients.FallaValidacion) As Entity.ValidationError
        Dim [to] = New Entity.ValidationError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .Node = from.Nodo, _
          .Antecedent = from.Antecedente, _
          .Suggestion = from.Sugerencia, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As SrvCancelation.FallaValidacion) As Entity.ValidationError
        Dim [to] = New Entity.ValidationError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .Node = from.Nodo, _
          .Antecedent = from.Antecedente, _
          .Suggestion = from.Sugerencia, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToValidationError(ByVal from As SrvRepository.FallaValidacion) As Entity.ValidationError
        Dim [to] = New Entity.ValidationError() With { _
          .RFC = from.RFC, _
          .Number = from.Numero, _
          .Description = from.Descripcion, _
          .Node = from.Nodo, _
          .Antecedent = from.Antecedente, _
          .Suggestion = from.Sugerencia, _
          .EventID = from.Evento _
        }
        Return [to]
    End Function
    Public Shared Function ToAppError(ByVal from As Exceptions.FallaAplicacion) As Entity.AppJsonError
        Dim [to] = New Entity.AppJsonError() With { _
            .Codigo = from.Codigo, _
            .Mensaje = from.Mensaje _
            }
        Return [to]
    End Function
End Class